<?php
namespace backend\controllers;

use Yii;
use backend\controllers\BaseController;
use common\components\RbacControl;
use backend\models\financial\Cashbills;
use backend\models\financial\Virtual;
use common\components\CreateExcel;

/**
 * 财务管理功能模块
 * @author 班未军
 */
class CoinController extends BaseController
{
    /**
     * @inheritdoc  账单管理
     */
    public function actionIndex()
    {   
        $model = new Cashbills;        
        return $this->render('index',$model->getBilllist());
    }
    
    /**
     * @inheritdoc  账单数据  导出
     */
    public function actionExportbill()
    {
        //生成excel
        $model = new Cashbills;
        $arr = $model->getInfo();        
        $excel = new CreateExcel();
        $excel->createByArray($arr,'账单数据列表',['ID','用户id','用户名','1收入/2支出','金额','成交时间','充值/消费','流水号']);
    }

    /**
     * @inheritdoc  积分管理
     */
    public function actionVirtual()
    {   
       
        $model = new Virtual;        
        return $this->render('virtual',$model->getVirtualList());
    }
    
    /**
     * @inheritdoc  积分数据  导出
     */
    public function actionExport()
    {   
        //生成excel
        $model = new Virtual;
        $arr = $model->getInfo();   
        $excel = new CreateExcel(); 
        $excel->createByArray($arr,'积分数据列表',['ID','用户id','用户名','积分量','简述','成交时间','充值/消费','流水号']);
    }
    

    
}